// pages/share-user-order-list/share-user-order-list.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    order_list:[],
    id:0,
    page:1,
    page_count:1,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (t) {
    getApp().page.onLoad(this, t);
    this.ss(t.id,1)
    this.setData({
      id:t.id
    })
  },

  ss: function (id,page) {
    var that = this,list = that.data.order_list;
    getApp().request({
      url:  getApp().api.share.user_order_list,
      data: {
        offline_user_id:id,
        page:page
      },
      success: function (t) {
        if(t.code == 0){
          for(var i = 0;i<t.data.list.length; i++){
            list.push(t.data.list[i])
          }
          that.setData({
            order_list:list,
            page_count:t.data.page_count
          })
        }
  
      },

    })

  },
  onReachBottom: function (t) {
    var page = this.data.page,that =this;
    if(that.data.page_count == page){
      wx.showToast({
        title: '到底了',
        icon: 'none',
        duration: 2000
      })
      
      
    }else{
      var  pa =  page+1
      that.ss(that.data.id,pa)
      that.setData({
        page:pa
      })
    }
  
  }

})